<template>
  <div>
     <ul>
      <li v-for="item in goodsList" :key="item.id" @click="goToDetail(item.id)">
        <img
          :src="item.list_pic_url"
          style="display: block"
          width="100%"
          alt=""
        />
        <div class="van-ellipsis">{{ item.name }}</div>
        <div class="price">{{ item.retail_price}}元</div>
      </li>
    </ul>
  </div>
</template>

<script>

  export default {
    name:'',
    data () {
     return {

      };
    },
   props:["goodsList"],
   methods:{
    //    跳转详情页
    goToDetail(id){
    this.$router.push({path:"/productDetail",query:{id} });
    }
   }
  }

</script>
<style scoped lang="less">
 ul {
  padding: 0.1rem 2%;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  li {
    width: 49%;
    margin-bottom: 0.1rem;
    background: #fff;
    text-align: center;
    .price {
      color: darkred;
    }
  }
}
</style>